home *** CD-ROM | disk | FTP | other *** search
/ Aminet 24 / Aminet 24 (1998)(GTI - Schatztruhe)[!][Apr 1998].iso / Aminet / comm / cnet / cnet_searcher.lha / cnetsearcher / Update200 < prev   
Text File  |  1997-09-05  |  5KB  |  100 lines

  1. /**************************************************************************\
  2.    $VER: CNet Searcher Update, v2.00 (5-Sep-97) by Dotoran of Frontiers!
  3. \**************************************************************************/
  4. options results;signal on SYNTAX;signal on ERROR;signal on IOERR
  5. a=sourceline(2);parse var a . ", "ver" ("vdate")" .;a=random(,,time("s"))
  6. tr=transmit;se=sendstring;gc=getchar;gu=getuser;gs=getscratch;mg=maygetchar
  7. a="rexxsupport.library";if ~show("l",a) then if ~addlib(a,0,-30) then exit
  8. parse source . . fp .;df=left(fp,max(lastpos('/',fp),lastpos(':',fp)))
  9.  
  10. tr "f1CNet Amiga Searcher, UPDATE 2.00, by Dotoran of Frontiers!n1"
  11.  
  12. se "   Welcome to CNet Amiga Searcher! This script will update a v1.46 of "
  13. se "Searcher to the NEWER formats used in v2.00! You should NOT use this "
  14. se "script if you are using an OLDER version of Searcher, or if you are "
  15. se "installing Searcher for the first time. Are you ready to continue? [No]: "
  16. gc;a=result;if a~="Y" then do;tr "No.";exit;end;else tr "Yes!"
  17.  
  18. a=exists(df"Puzzles/Puz01") ; if a=0 then do
  19.   se "n1   You are NOT using v1.46 of Searcher! Please install this file for "
  20.   tr "the first time OR get v1.46 first!"
  21.   exit ; end
  22.  
  23. se "n1   There are numerous NEW additions made to the program. Please take a "
  24. se "moment to read through the HISTORY guide file to get an idea as to what "
  25. tr "exactly has changed in this version."
  26.  
  27. se "n1   The `!Puzzles' data file has been changed slightly and is now being "
  28. se "stored directly in the `"df"' directory, instead of within the `Puzzles/' "
  29. se "subdirectory. The filenames for each puzzle have also changed, so as to "
  30. se "make adding NEW puzzles into Searcher a breeze. Please refer to Searcher's "
  31. se "README guide file for more information. Tap any key to begin the conversion "
  32. tr "process...g1n1@4"
  33.  
  34. se "Reading your !Puzzles file..."
  35. call open(f1,df"Puzzles/!Puzzles","R")
  36.   do i=1 until eof(f1) ; a=readln(f1)
  37.     if a>"" then do ; parse var a n.i" "p.i
  38.       pn.i=compress(translate(p.i," ","(),.!?`'"d2c(34)))
  39.     end
  40.   end i ; tot=i-1
  41. call close(f1)
  42. tr "Done.n1"
  43.  
  44. call open(f1,df"!Puzzles","W")
  45.   do i=1 to tot
  46.     se "Renaming `Puz"right(n.i,2,"0")"' as `"pn.i"' now..."
  47.     address command "rename "df"Puzzles/Puz"right(n.i,2,"0")" "df"Puzzles/"pn.i
  48.     tr "done."
  49.     if exists(df"Puzzles/Puz"right(n.i,2,"0")".champs") then do
  50.       se "Renaming `Puz"right(n.i,2,"0")".champs' as `"pn.i".champs' now..."
  51.       address command "rename "df"Puzzles/Puz"right(n.i,2,"0")".champs "df"Puzzles/"pn.i".champs"
  52.       tr "done."
  53.     end
  54.       se "  Counting words in the `"pn.i"' puzzle..."
  55.       call open(f2,df"Puzzles/"pn.i,"R")
  56.         do j=1 until eof(f2);a=readln(f2);end j;wds=j-1
  57.       call close(f2);tr wds" total words!"
  58.       se "    Adding this entry to !Puzzles..."
  59.       call writeln(f1,right(wds,2,"0")" "p.i)
  60.       tr "done.n1"
  61.   end i
  62. call close(f1)
  63.  
  64. se "Deleting the old `"df"Puzzles/!Puzzles' file..."
  65. call DELETE(df"Puzzles/!Puzzles");tr "done."
  66.  
  67. se "n1Sorting Puzzles Alphabetically by Title..."
  68. address command "sort "df"!Puzzles "df"!Puzzles COLSTART 3";tr "done."
  69.  
  70. se "n1Sorting Puzzles by the Number of Words..."
  71. address command "sort "df"!Puzzles "df"!Puzzles2";tr "done."
  72.  
  73. se "n1   CNet Amiga Searcher, v2.00 now allows for Multiple Game Saves. This "
  74. se "means the SAVED GAME files have changed format. While completing the coding "
  75. se "of this new feature, I discovered a bug in the SAVE GAME feature in the "
  76. se "v1.46 version which could cause the Answers Hint Option to fail. Because "
  77. se "of this, I'll now DELETE any existing SAVED GAME files found on your BBS "
  78. tr "pertaining to Searcher. Press any key to begin this process...g1"
  79.  
  80. SIGNAL OFF ERROR /* In case NO saved files are found */
  81. address command "delete mail:users/#?/_searcher"
  82. SIGNAL ON ERROR
  83.  
  84. se "n1   The conversion process is complete! Please take a moment to read "
  85. se "through the HISTORY guide file and refer to the README guide file for "
  86. se "info on adding NEW puzzles into Searcher. You won't believe how EASY it "
  87. tr "is now! hehe"
  88.  
  89. exit
  90. CHECK:;if ARG() & ARG(1)~="###PANIC" then return ARG(1)
  91.   getcarrier;if result="TRUE" then if ARG() then return ARG(1);else return
  92.   logentry "Lost Carrier!!";bufferflush;exit
  93. SYNTAX:;ERROR:;IOERR:;e1="n1 Error: "rc" ("errortext(rc)")"
  94.   e2="  Line: "left(sigl,4)"File:";c="`"fp", "ver"'";e2=e2" "c;tr e1;tr e2
  95.   logentry e1;logentry e2;e=strip(translate(sourceline(sigl),"\{",""))
  96.   do while e~="";e3="Source: "left(e,37);tr e3;logentry e3;e=substr(e,38);end
  97.   bufferflush
  98. /**************************************************************************\
  99. \****************************************** Frontiers BBS (716)/823-9892 **/
  100.